Skip to main content

iphoneSafeAreaInsets

Type

function

Summary

Returns the safe area insets of the device the app is running on.

Syntax

iphoneSafeAreaInsets()

Description

Use the iphoneSafeAreaInsets function to get the safe area insets of the device the app is running on. The safe area of a view reflects the area not covered by device furniture items, e.g. the notch, that obscure a view controller's view, and the insets denote the spacing between the device's screen's edges and where this safe area begins. These can be used to adjust your app's user interface elements to avoid areas that will not be fully visible.

Examples

local tInsets
put iphoneSafeAreaInsets() into tInsets
if the top of field "Title" < item 2 of tInsets then
set the top of field "Title" to item 2 of tInsets
end if

local tSafeAreaRect
put the screenRect into tSafeAreaRect
add item 1 of iphoneSafeAreaInsets() to item 1 of tSafeAreaRect
add item 2 of iphoneSafeAreaInsets() to item 2 of tSafeAreaRect
subtract item 3 of iphoneSafeAreaInsets() from item 3 of tSafeAreaRect
subtract item 4 of iphoneSafeAreaInsets() from item 4 of tSafeAreaRect
set the rect of field "FullSafeAreaField" to tSafeAreaRect

Compatibility and Support

Introduced

LiveCode 9.6.6

OS

ios

Platforms

mobile

Thank you for your feedback!

Was this page helpful?